package edu.maping.easy.gui;

import processing.core.PApplet;
import processing.core.PGraphics;
import fisica.FCircle;

public class CircleButton extends FCircle {
	
	public String name = null;
	float textOffset = 0;
	int textColor = 255;
	int x, y = 0;
	public int sizeHover = 0;
	public int realSize = 0;

	public CircleButton(String name, float x, float y, int size, PApplet pApplet) {
		super(size);
		sizeHover = size + 20;
		realSize = size;
		this.name = name;
		textOffset = pApplet.textAscent() - pApplet.getHeight() / 2;
		setStatic(true);
		setPosition(x, y);
		setGrabbable(false);
	}

	public void draw(PGraphics applet) {
		super.draw(applet);
		preDraw(applet);
		applet.fill(textColor);
		applet.textAlign(PApplet.CENTER);
		applet.textSize(12);
		applet.text(name, -10, 5);
		postDraw(applet);
	}
	
	public void setTextColor(int i){
		textColor = i;
	}
	
	public int getColor() {
		return m_fillColor;
	}

}
